<div id="degxtool">
    <table>
        <tr>

                <td>

                    <if condition="authCheck1('Home/Zds/add')">
                        <a href="#" id= "aaa1" class="easyui-linkbutton"  onclick='show_add_degx()' data-options="iconCls:'icon-standard-folder-page',plain:true">添加</a>

                        <a href="#" class="easyui-linkbutton"  onclick='dele_degs()' data-options="iconCls:'icon-standard-page-white-delete',plain:true">删除</a>


                        <a href="#" class="easyui-linkbutton"  onclick='show_edit_degx()' data-options="iconCls:'icon-standard-application-edit',plain:true">编辑</a>




                <td>
                    <div class="datagrid-btn-separator"></div>
                </td>


            <td>
                <a href="#" class="easyui-linkbutton"  onclick="viewDegx()" data-options="iconCls:'icon-standard-application-view-gallery',plain:true">查看</a>


                <!--<a href="#"  class="easyui-linkbutton"  onclick="save_zds1('{$index}')" data-options="iconCls:'icon-standard-table-save',plain:true">下载</a>-->
            </td>
            <td>
                <div class="datagrid-btn-separator"></div>
            </td>

            <td>
                <a href="#" class="easyui-linkbutton"  onclick="reloadDegx()" data-options="iconCls:'icon-standard-arrow-refresh',plain:true">刷新</a>
            </td>
            <td>
                <div class="datagrid-btn-separator"></div>
            </td>
            <td>
                <div style="float:right;">
                    <input  id='search_degx_box' class="easyui-searchbox" data-options="" style="width:400px;"/>
                </div>
                <div id="mm_degx" style="width:400px">
                    <div data-options="name:'title',iconCls:'icon-standard-table-edit'">名称</div>
                    <div data-options="name:'header',iconCls:'icon-standard-table-edit'">计生号/流水号/任务号</div>
                    <div data-options="name:'ids',iconCls:'icon-standard-table-edit'">编号</div>
                    <div data-options="name:'nickname',iconCls:'icon-standard-table-edit'">作者</div>
                    <div data-options="name:'rwh',iconCls:'icon-standard-table-edit'">任务号</div>

                </div>
            </td>
        </tr>
        <tr>
            <div>

                <span class="add_label">平台：</span>
                <input class="easyui-combobox" name="pt" id="add_search_degx_pt"
                       data-options="editable:false,panelHeight:'auto',required:false,multiple:'true'"
                       style="width:150px;" >

                <span class="add_label">车型分类：</span>
                <input class="easyui-combobox" name="cl" id="add_search_degx_cl"
                       data-options="editable:false,panelHeight:'auto',required:false,multiple:'true'"
                       style="width:150px;">

                <span class="add_label">驱动：</span>
                <input class="easyui-combobox" name="qd" id="add_search_degx_qd"
                       data-options="editable:false,panelHeight:'auto',required:false,multiple:'true'"
                       style="width:150px;">

                <span class="add_label">燃料型式：</span>
                <input class="easyui-combobox" name="rl" id="add_search_degx_rl"
                       data-options="editable:false,panelHeight:'auto',required:false,multiple:'true'"
                       style="width:150px;">
                <br>
                <span class="add_label">其他：</span>
                <input id="" name="qtfl" class="easyui-textbox"
                       data-options="iconCls:'',editable:true,required:false" style="width:150px"/>
            </div>

        </tr>
    </table>
    <!-- 全局搜索 -->
    <table  id="finaBoxDegx" style="display:none;">
        <tr >
            <td style="padding:0px 0px 0px 5px" colspan="5">
                <div class="table-btn-separator"></div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="finaSeDiv">
                    <label for="name">编号:</label>
                    <input class="easyui-textbox" type="text" name="ids" id="f_{$index}_ids" style="width:130px" />
                </div>
            </td>
            <td>
                <div class="finaSeDiv">
                    <label for="name">名称:</label>
                    <input class="easyui-textbox" type="text" name="title" id="f_{$index}_title" style="width:130px" />
                </div>
            </td>
            <td>
                <div class="finaSeDiv">
                    <label for="name">车间:</label>

                    <input id="f_{$index}_cj" name="cj" class="easyui-textbox" data-options="iconCls:'',editable:true,panelHeight:'auto'"  style="width:130px" />


                </div>
            </td>
            <td>
                <div class="finaSeDiv">
                    <label for="name">工位:</label>

                    <select id="f_{$index}_gw" class="easyui-combobox" name="gws" style="width:130px;">

                    </select>

                    <!-- <input id="f_{$index}_gw" name="gws" class="easyui-textbox" data-options="iconCls:'',editable:true,panelHeight:'auto'"  style="width:130px" /> -->
                </div>
            </td>
            <td>
                <div class="finaSeDiv">
                    <label for="name">车型/配置:</label>
                    <input class="easyui-textbox" type="text" name="cx" id="f_{$index}_cx" style="width:130px" />
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="finaSeDiv">
                    <label for="name">分组:</label>

                    <input id="f_{$index}_fz" class="easyui-combogrid" data-options="" name="fz[]" style="width:120px;"/>

                </div>
            </td>
            <td>
                <div>
                    <label for="name">作者:</label>
                    <input class="easyui-textbox" type="text" name="nickname" id="f_{$index}_nickname" style="width:130px" />
                </div>
            </td>
            <td colspan="2">


                <div class="finaSeDiv2">
                    <label for="name">日期:</label>

                    <input  name="creatdates" id="f_{$index}_creatdates"   type= "text" class= "easyui-datebox" style="width:100px"/>  到
                    <input  name="creatdatee" id="f_{$index}_creatdatee"   type= "text" class= "easyui-datebox" style="width:100px"/>

                    <a  href="#" onclick="finaZds('{$index}')" class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>
                </div>
            </td>
        </tr>
    </table>
</div>


<!-- 下载插件 -->
<div id="weboffice_plug_down_windows" class="easyui-dialog" style="width:335px; height: 212px;padding: 10px 50px; overflow:hidden;" title="&nbsp;&nbsp;下载插件" data-options="iconCls:'icon-standard-folder-page',buttons:'#dlg-weboffice_plug_down_windows',closed:true,resizable:false,modal:true,closable:true">

    <a href="__PUBLIC__/word/weboffice7-exe.rar" target="_blank">&nbsp;1、weboffice插件</a><br>
    <a href="__PUBLIC__/word/ffactivex-setup-r39.rar" target="_blank">&nbsp;2、浏览器插件</a><br>
    请安装上面两个插件并在chrome浏览器或者360浏览器极速模式下使用作业指导书模块！
    <iframe  src="about:blank" frameBorder="0" marginHeight="0" marginWidth="0" style="position:absolute; visibility:inherit; top:0px;left:0px;width:100%; height:100%;z-index:-1; filter:alpha(opacity=0);"></iframe>
</div>
<div id="dlg-weboffice_plug_down_windows">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="javascript:$('#weboffice_plug_down_windows').dialog('close')">取消</a>
</div>


<div id="dg-zfinfo" class="easyui-dialog" style="width: 580px; height: 240px; padding: 5px; overflow: hidden;" title="&nbsp;&nbsp;作废信息" data-options="iconCls:'icon-standard-folder-page',buttons:'#dlg-zfinfo-tool',closed:true,resizable:false,modal:true,closable:true">


    <form id="add_zfinfo" method="post">

        <input name="zfinfo" id="bxinfo" class="easyui-textbox" style="width: 100%; height: 150px;"  data-options="multiline:true,prompt:'请输入作废理由...',required:true"/>
        <br />

    </form>


    <iframe id="iframe2" src="about:blank" frameBorder="0" marginHeight="0" marginWidth="0" style="position:absolute; visibility:inherit; top:0px;left:0px;width:100%; height:100%;z-index:-1; filter:alpha(opacity=0);"></iframe>

</div>
<div id="dlg-zfinfo-tool">
    <!-- <div class="tool_tip">只有自己发布的装配问题记录才能进行编辑！！</div> -->
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="will_invalid1('{$index}')">作废</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="javascript:$('#dg-zfinfo').dialog('close')">取消</a>
</div>

<!--使用分组-->

<div id="syfz_dialog" class="easyui-dialog"
     style="width: 580px; height: 240px; padding: 5px; overflow: hidden;"
     title="&nbsp;&nbsp;修改适用字组"
     data-options="iconCls:'icon-standard-building-add',buttons:'#syfz_dialog_tool',closed:true,resizable:false,modal:false,closable:true">


    <form id="syfz_form" method="post">




        <input  name="syfz" id="syfz_text_mody" class="easyui-textbox"
                data-options="iconCls:'',multiline:true,editable:true,required:true,validType:'syfz',prompt:'只能输入英文大写字母、数字，并以英文“,”隔开！'"
                style="width: 100%; height: 150px;"/>

    </form>


</div>

<div id="syfz_dialog_tool">
    <div class="tool_tip" id="pl_contentwordage">
    </div>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
       onclick="syfz_mody()">确认</a>
    <a href="#" class="easyui-linkbutton"
       data-options="iconCls:'icon-cancel'"
       onclick="javascript:$('#syfz_dialog').dialog('close')">取消</a>
</div>


<div id="dg-zuofei" class="easyui-dialog" style="width: 580px; height: 150px; padding: 15px; overflow: hidden;" title="&nbsp;&nbsp;作废信息" data-options="iconCls:'icon-standard-folder-page',buttons:'#dlg-zuofei-tool',closed:true,resizable:false,modal:true,closable:true,prompt:'请填写作废原因……'">


    <form id="form_zuofei" method="post">

        <select id="bx_zuofei" class="easyui-combobox" name="zfinfo" style="width:100%;height:32px;" data-options="editable:true,required:true,panelHeight:'auto'">
            <option value="版本升级">版本升级</option>
            <option value="状态作废">状态作废</option>
        </select>



        <!--<input name="zuofei" id="bx_zuofei" class="easyui-textbox" style="width: 100%; height: 150px;"  data-options="multiline:true,prompt:'请输入作废理由...',required:true"/>-->
        <br />

    </form>



</div>
<div id="dlg-zuofei-tool">
    <!-- <div class="tool_tip">只有自己发布的装配问题记录才能进行编辑！！</div> -->
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="will_invalid()">作废</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="javascript:$('#dg-zuofei').dialog('close')">取消</a>
</div>

<script>

    $("#add_search_degx_pt").combobox({
        url:'__APP__/Home/Degx/cxfl',
        valueField:'value',
        textField:'title',
        queryParams: {
            "fl" : 'pt'
        }
    });
    $("#add_search_degx_cl").combobox({
        url:'__APP__/Home/Degx/cxfl',
        valueField:'value',
        textField:'title',
        queryParams: {
            "fl" : 'cl'
        }
    });
    $("#add_search_degx_qd").combobox({
        url:'__APP__/Home/Degx/cxfl',
        valueField:'value',
        textField:'title',
        queryParams: {
            "fl" : 'qd'
        }
    });
    $("#add_search_degx_rl").combobox({
        url:'__APP__/Home/Degx/cxfl',
        valueField:'value',
        textField:'title',
        queryParams: {
            "fl" : 'rl'
        }
    });
    

    // 适用分组

    function update_zyfz(index){
        var row = $('#zds_' + index + '_dg').datagrid("getSelected");
        if (row) {

            $('#syfz_dialog').dialog('open');

            $("#syfz_text_mody").textbox('setText',row.syfz);



        } else {
            $.messager.alert("请选择", "请选择要修改“适用字组”的作业指导书", "info");
        }
    }


    function syfz_mody() {

        var row = $('#zds_editor_dg').datagrid("getSelected");
        $('#syfz_form').form('submit', {
            url: APP+'/Home/Zds/syfz_mody',
            onSubmit: function (param) {   //param为保存或者发布
                param.id = row.id;
                param.syfz = $("#syfz_text_mody").textbox('getText');


            },

            success: function (data) {
                data = $.parseJSON(data);

                if (data.status == 1) {
                    $('#zds_editor_dg').datagrid("reload");
                    $('#syfz_dialog').dialog('close');
                    $.messager.alert('成功', data.msg, 'info');
                } else {
                    $.messager.alert('失败', data.msg, 'info');


                }

            }
        });
    }

    function weboffice_plug_down(){
        $("#weboffice_plug_down_windows").dialog("open").dialog('setTitle', '&nbsp;&nbsp;下载插件');
    }
    function save_zds1(index){
        var row = $('#zds_'+index+'_dg').datagrid("getSelected");
        if (row) {
            var url='http://192.168.8.200/wordupload/'+row.urls;



            var $eleForm = $("<form method='get'></form>");

            $eleForm.attr("action",url);

            $(document.body).append($eleForm);

            //提交表单，实现下载
            $eleForm.submit();






        } else {
            $.messager.alert("请选择", "请选择要下载的作业指导书", "info");
        }
    }

    function outlist(index){
        var grid = $('#zds_'+index+'_dg');
        // var options = grid.datagrid('getPager').data("pagination").options;
        // var pageNumber = options.pageNumber;
        // var pageSize=options.pageSize;
        window.location.href=APP+'/Home/Zds/out/';
    }
</script>